package com.zenika.training.wicket.zencontact.panel;import java.util.List;import java.util.Locale;import org.apache.wicket.markup.html.form.ChoiceRenderer;import org.apache.wicket.markup.html.form.DropDownChoice;import org.apache.wicket.model.IModel;public class LocaleDropDown extends DropDownChoice {	private class LocaleRenderer extends ChoiceRenderer {		public Object getDisplayValue(Object locale) {			return ((Locale) locale).getDisplayLanguage(getLocale());		}	}	public LocaleDropDown(String id, List supportedLocales) {		super(id, supportedLocales);		setChoiceRenderer(new LocaleRenderer());		setModel(new IModel() {			public void detach() {			}			public Object getObject() {				return getSession().getLocale();			}			public void setObject(Object object) {				getSession().setLocale((Locale) object);			}		});	}	protected boolean wantOnSelectionChangedNotifications() {		return true;	}}